package com.occludens.servlet;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.googlecode.objectify.Key;
import com.googlecode.objectify.ObjectifyService;
import com.occludens.admin.ui.Command;
import com.occludens.admin.ui.Menu;
import com.occludens.data.admin.util.AdminUtil;

@SuppressWarnings("serial")
public class AdminServlet extends HttpServlet {
	
	public void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
		try {
			
			AdminUtil.register();
			//Command Search
			//Menu Right
				//Command Bootply
				//Menu Alert
					//Command Link 1
					//Command Link 2
				//Command Toggle
				//Command User
			Menu appNavigationToolbar = new Menu("APPNavigationToolbar");
			appNavigationToolbar.save();
			Command searchCommand = new Command("Search");
			searchCommand.save();
			Menu appNavigationToolbarRight = new Menu("appNavigationToolbarRight");
			appNavigationToolbarRight.save();
			Command bootplyCommand = new Command("Bootply");
			bootplyCommand.save();
			
			Menu alertMenu = new Menu("Alert");
			alertMenu.save();
			Command alertLink1Command = new Command("Link 1");
			alertLink1Command.save();
			Command alertLink2Command = new Command("Link 2");
			alertLink2Command.save();
			alertMenu.addItems(alertLink1Command, alertLink2Command);
			alertMenu.save();
			
			Command toggleCommand = new Command("Toggle");
			toggleCommand.save();
			Command userCommand = new Command("User");
			userCommand.save();
			appNavigationToolbarRight.addItems(bootplyCommand, alertMenu, toggleCommand, userCommand);
			appNavigationToolbarRight.save();
			
			appNavigationToolbar.addItems(searchCommand, appNavigationToolbarRight);
			appNavigationToolbar.save();
			
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
